<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>工资想过万，键盘要敲烂</title>
    <style></style>
  </head>
  <input type="text" />
  <body>
    <script>
      let timeId

      document.querySelector('input').oninput = function () {
        // 清除上一次开启的延时器
        clearTimeout(timeId)
        timeId = setTimeout(() => {
          console.log(this.value)
        }, 500)
      }
    </script>
  </body>
</html>
